<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function add() {
            let sum = 0
            for (let i = 0, j = arguments.length; i < j; i++) {
                sum += arguments[i];
            }
            return sum;
        }
        sum = add(1, 2, 3, 4, 5, 6)
        console.log(sum);

        // function func1(a, b, c) {
        //     console.log(arguments[0]);
        //     // Expected output: 1

        //     console.log(arguments[1]);
        //     // Expected output: 2

        //     console.log(arguments[2]);
        //     // Expected output: 3
        // }

        // func1(1, 2, 3);

    </script>
</body>

</html>